<?php


namespace App\WebSocket;


use EasySwoole\Socket\AbstractInterface\Controller;

class Base extends Controller
{
    protected function onRequest(?string $actionName): bool
    {
        //判断token
        //var_dump($actionName);
        /*
        $param = $this->caller()->getArgs();
        if(!array_key_exists('token',$param)){
            return false;
        }

        $token  = $param['token'];
        $uid  = $param['uid'];
        //var_dump($token);
        $redis = RedisPool::defer();

        //intval($data['user_id'])
        $vaild = intval($redis->get('tp:'.hash_hmac('ripemd160', $token, 'i3d6o32wo8fvs1fvdpwens')));


        if($vaild != 0 && $uid == $vaild){
            //保存上下文
            ContextManager::getInstance()->set('user_id',$vaild);
            return true;
        }else{
            $data = [
                "type" => "TOKEN_EXPIRE"
            ];
            $this->response()->setMessage(json_encode($data));
            $this->response()->end();
            return false;
        }*/

    }


}